package com.itheima.text1;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.util.Scanner;

public class UDPSend {
    public static void main(String[] args) throws IOException {
        //创建发送端Socket对象
        DatagramSocket socket = new DatagramSocket();
        //键盘录入
        Scanner sc = new Scanner(System.in);

        String s = sc.nextLine();

        while (true){
            if ("over".equals(s)){
                break;
            }

            byte[] bytes = s.getBytes();

            DatagramPacket packet = new DatagramPacket(bytes,bytes.length,
                    InetAddress.getByName("192.168.23.64"),10001)
            ;

            socket.send(packet);

        }
      //  socket.close();

    }
}
